package org.csu.sei.controller;

import com.alibaba.fastjson.JSONObject;
import org.csu.sei.common.ReturnJson;
import org.csu.sei.entity.Title;
import org.csu.sei.service.ITitleService;
import org.csu.sei.service.impl.TitleServiceimpl;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/title")
public class TitleController {
    @Resource
    ITitleService titleService;

    @GetMapping("/all")
    public JSONObject getAllTitle(){
        List<Title> titleList=titleService.queryAllTitle();
        JSONObject json = new JSONObject();
        json.put("title_list",titleList);
        return ReturnJson.successRes(json);
    }


}
